package dashboard
import "github.com/K-Phoen/sdk"
type LinkIcon string
const (
IconExternal LinkIcon = "external"
IconDashboard LinkIcon = "dashboard"
IconQuestion LinkIcon = "question"
IconInfo LinkIcon = "info"
IconBolt LinkIcon = "bolt"
IconDoc LinkIcon = "doc"
IconCloud LinkIcon = "cloud"
)
type ExternalLink struct {
Title string
Description string
URL string
Icon LinkIcon
IncludeTimeRange bool
IncludeVariableValues bool
OpenInNewTab bool
}
func (link ExternalLink ) asSdk () sdk .Link {
falsePtr := false
icon := string (IconExternal )
if link .Icon != "" {
icon = string (link .Icon )
}
return sdk .Link {
Title : link .Title ,
Tooltip : &link .Description ,
URL : &link .URL ,
AsDropdown : &falsePtr ,
Icon : &icon ,
IncludeVars : link .IncludeVariableValues ,
KeepTime : &link .IncludeTimeRange ,
Tags : make ([]string , 0 ),
TargetBlank : &link .OpenInNewTab ,
Type : "link" ,
}
}
type DashboardLink struct {
Title string
Tags []string
AsDropdown bool
IncludeTimeRange bool
IncludeVariableValues bool
OpenInNewTab bool
}
func (link DashboardLink ) asSdk () sdk .Link {
return sdk .Link {
Title : link .Title ,
Tags : link .Tags ,
AsDropdown : &link .AsDropdown ,
IncludeVars : link .IncludeVariableValues ,
KeepTime : &link .IncludeTimeRange ,
TargetBlank : &link .OpenInNewTab ,
Type : "dashboards" ,
}
}
The pages are generated with Golds v0.8.2 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .